import Taro, { Component } from '@tarojs/taro'
import { View, Swiper, SwiperItem, Text } from '@tarojs/components'
import styles from './index.module.scss'
import SeckillCountdown from "@/components/countdown/seckill";
import moment from "@/assets/js/moment.min";
import TimeIcon from '@/assets/images/time-icon.png'
import {FyImg} from "@/components/index";
import {getRollBuyRecord} from "@/api/commonApi";
import { shuffle, getFilter } from "@/utils/utils"

/**
 * 用户购买记录
 */
interface IProps {
  top: number
  buyList: any
}
export default class Index extends Component<IProps, {}> {
  props: any
  state: any

  constructor() {
    super(...arguments)
    this.state = {
    }
  }

  componentDidMount() {
  }

  render() {
    const { buyList, top } = this.props
    return buyList.length ? <View className={styles.recordTwo} style={{top: `${top}px`}}>
      <Swiper autoplay circular vertical interval={2000} className={styles.list}>
        {buyList.map((item, k) => {
          return (<SwiperItem key={k}>
            <View className='t-o-e'>{item.name}{item.time}分钟前购买了该商品</View>
          </SwiperItem>)
        })}
      </Swiper>
    </View> : null
  }
}
